﻿@model IEnumerable<WarFrota.Models.Manutencao>

@{
    ViewBag.Title = "Manutenção";
}

<h2>Lista de Manutenção</h2>

<p>
    @Html.ActionLink("Novo", "Create")
</p>
<p>
    <form>
      <fieldset>
        <legend>Filtro</legend>

        <div class="editor-label">
            Placa
        </div>

        <div class="editor-label">
            <input id="filtro" name="filtro" type="text"/>
        </div>
      <input type="submit" value="Consultar"/>
      </fieldset>
    </form>
</p>
<table>
    <tr>
        <th>
            Placa
        </th>
        <th>
            Tipo de Manutenção
        </th>
        <th>
            Data
        </th>
        <th>
            Custo
        </th>
        <th>
            Observação
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink(item.Placa, "Details", "Veiculo", new { placa=item.Placa }, null)
        </td>
        <td>
            @Html.ActionLink(item.TipoManutencao.Descricao, "Details", "TipoManutencao", new { id=item.TipoManutencaoId }, null)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Data)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Custo)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Observacao)
        </td>
        <td>
            @Html.ActionLink("Editar", "Edit", new { id=item.Id }) |
            @Html.ActionLink("Detalhes", "Details", new { id=item.Id }) |
            @Html.ActionLink("Excluir", "Delete", new { id=item.Id })
        </td>
    </tr>
}

</table>
